<?php 
$table = "tttj.channel";

$list_ios = array();
$list_android = array();

$query=exec_db("select channel,cha_name,pt from $table");
while($value=mysqli_fetch_assoc($query))
{
// 	$list[$value['channel']]=trim($value['cha_name']);
	if ($value['pt']==2){
		$list_ios[$value['channel']] = trim($value['cha_name']);
	}
	if ($value['pt']==1){
		$list_android[$value['channel']] = trim($value['cha_name']);
	}
}
/* $content='<?php ';
$content .= "\$channel = ". var_export($list,true) . ";\r\n";
$content .= ' ?>'; */
$content_ios='<?php ';
$content_ios .= "\$channel = ". var_export($list_ios,true) . ";\r\n";
$content_ios .= ' ?>';
$content_android='<?php ';
$content_android .= "\$channel = ". var_export($list_android,true) . ";\r\n";
$content_android .= ' ?>';
// file_put_contents(S_ROOT . 'source/data/channel' . $appid . '.php', $content);
file_put_contents(S_ROOT . 'source/data/channel_ios' . $appid . '.php', $content_ios);
file_put_contents(S_ROOT . 'source/data/channel_android' . $appid . '.php', $content_android);
?>